Skip to content

Instantly share code, notes, and snippets.

View aramodi's full-sized avatar
🎯
Working on something new - stay tuned!

Arash M. aramodi

🎯
Working on something new - stay tuned!
View GitHub Profile
@cowboy
cowboy / github_post_recieve.php
Created October 11, 2010 02:04
GitHub PHP webhook to auto-pull on repo push
<?php
// Use in the "Post-Receive URLs" section of your GitHub repo.
if ( $_POST['payload'] ) {
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' );
}
?>hi
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@ericremoreynolds
ericremoreynolds / client.html
Last active February 25, 2024 21:55
Flask-socket.io emit to specific clients
<html>
<body>
<h1>I feel lonely</h1>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script>
<script type="text/javascript" charset="utf-8">
var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('connect', function() {
socket.emit('connected');
@joakin
joakin / git-find-me-the-fucking-deleted-file.sh
Last active October 26, 2024 19:11
finding a deleted file in a git repository
# If you don't remember the exact path/name, search the log for deleted files
git log --diff-filter=D --summary | grep delete
# Find the file you want to get from the ouput, and use the path
# Find the commits that involved that path
git log --all -- some/path/to/deleted.file
# Bring the file back to life to the current repo (sha commit of parent of commit that deleted)
git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file
@githubutilities
githubutilities / Apple-real-device-debugging.md
Last active November 18, 2023 12:41
install ipa using command line

Apple Real Devices Debugging

What you need

  • certificate--which tells your devices that Apple trust you
  • a app id
  • a test device
  • a provisioning profile
Canidae
Felidae
Cat
Cattle
Dog
Donkey
Goat
Guinea pig
Horse
Pig
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 15, 2024 16:02
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

--------- beginning of main
07-27 08:04:14.192 15 15 I : debuggerd: starting
--------- beginning of system
07-27 08:04:14.195 16 16 I vold : Vold 3.0 (the awakening) firing up
07-27 08:04:14.195 16 16 V vold : Detected support for: ext4 vfat
07-27 08:04:14.196 16 16 E vold : Failed to open default fstab /fstab.goldfish: Operation not permitted
07-27 08:04:14.196 16 16 E vold : Error reading configuration... continuing anyways: Operation not permitted
07-27 08:04:14.202 16 26 D vold : e4crypt_init_user0
07-27 08:04:14.202 16 26 D vold : e4crypt_prepare_user_storage for volume null, user 0, serial 0, flags 1
07-27 08:04:14.202 16 26 D vold : Preparing: /data/system/users/0
@EvieePy
EvieePy / bot_example.py
Last active July 22, 2024 16:51
A Cogs Example for the rewrite version of - discord.py
import discord
from discord.ext import commands
import sys, traceback
"""This is a multi file example showcasing many features of the command extension and the use of cogs.
These are examples only and are not intended to be used as a fully functioning bot. Rather they should give you a basic
understanding and platform for creating your own bot.
These examples make use of Python 3.6.2 and the rewrite version on the lib.
@wschenk
wschenk / login.js
Created November 28, 2017 02:41
create-react-app login.js rmwc example
import React, {Component} from 'react'
import { TextField, Dialog } from 'rmwc';
class Login extends Component {
state = {email: "", password: ""}
handleChange = (val) => (evt) => { this.setState( {...this.state, [val]: evt.target.value} ) }
loginForm = () => {
return (
<div>