Skip to content

Instantly share code, notes, and snippets.

View rpechayr's full-sized avatar

Romain Péchayre rpechayr

View GitHub Profile
{
"event": {
"start_date": "2011-02-25",
"created_at": "2011-02-17T09:35:50Z",
"title": "Forum de l'Informatique",
"updated_at": "2011-02-22T16:12:04Z",
"guests_visible": true,
"id": 35,
"description": "The description of event #35",
"end_date": "2011-02-25"
@rpechayr
rpechayr / gist:1400840
Created November 28, 2011 15:48
Est-ce que ça compile
typedef struct
{
int myInt;
} MyClass;
int main (int argc, char const *argv[])
{
MyClass *myInstance = false;
return 0;
}
@rpechayr
rpechayr / gist:1401019
Created November 28, 2011 16:40
Et ça ça marche ?
typedef struct
{
int myInt;
} MyClass;
int main (int argc, char const *argv[])
{
MyClass *myInstance = true;
return 0;
}
@rpechayr
rpechayr / test.html
Created March 2, 2012 19:00
Safari onbeforeunload bug
<script>
window.onbeforeunload = function (e) {
e = e || window.event;
// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Any string';
}
// For Safari
@rpechayr
rpechayr / watchSound.m
Last active August 27, 2019 09:17
Watch source change (Headphone vs. Internal Speaker)
NSLog(@"Starting");
AudioDeviceID defaultDevice = 0;
UInt32 defaultSize = sizeof(AudioDeviceID);
const AudioObjectPropertyAddress defaultAddr = {
kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeGlobal,
kAudioObjectPropertyElementMaster
};
recipes:
host: https://reciped.herokuapp.com
token: 987658987656789
- env: COMMAND=PROVIOSION APP_NAME=toto
recipe: container_prod.rb
type: ruby
- env: COMMAND=INIT APP_NAME=toto
recipe: container_prod.rb
type: ruby
- env: COMMAND=MOUNT APP_NAME=toto
@rpechayr
rpechayr / gitconfig
Created September 30, 2014 14:47
My git config
[user]
name = rpechayr
email = rpechayr@gmail.com
[alias]
co = checkout
ci = commit
br = branch
st = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
m = checkout master
@rpechayr
rpechayr / countries.json
Created February 19, 2015 16:37
Countries
countries = [["Andorra", "00376"], ["United Arab Emirates", "00971"], ["Afghanistan", "0093"], ["Antigua and Barbuda", "0111"], ["Anguilla", "0111"], ["Albania", "00355"], ["Armenia", "00374"], ["Netherlands Antilles", "00599"], ["Angola", "00244"], ["Antarctica", "672"], ["Argentina", "0054"], ["American Samoa", "0111"], ["Austria", "0043"], ["Australia", "001161"], ["Aruba", "00297"], ["Åland Islands", "358"], ["Azerbaijan", "810994"], ["Bosnia and Herzegovina", "00387"], ["Barbados", "0111"], ["Bangladesh", "00880"], ["Belgium", "0032"], ["Burkina Faso", "00226"], ["Bulgaria", "00359"], ["Bahrain", "00973"], ["Burundi", "00257"], ["Benin", "00229"], ["Saint Barthélemy", "590"], ["Bermuda", "0111"], ["Brunei Darussalam", "00673"], ["Bolivia", "0010591"], ["Bonaire, Sint Eustatius and Saba", "00599"], ["Brazil", "001455"], ["Bahamas", "0111"], ["Bhutan", "00975"], ["Bouvet Island", ""], ["Botswana", "00267"], ["Belarus", "810375"], ["Belize", "00501"], ["Canada", "0111"], ["Cocos (Keeling) Islands", "001161
@rpechayr
rpechayr / .gitconfig
Created May 18, 2015 13:38
Git config
[user]
name = <githubusername>
email = <email>
[alias]
co = checkout
ci = commit
br = branch
st = status
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
m = checkout master
@rpechayr
rpechayr / package.json
Created August 21, 2015 09:50
Standard React + browserify package.json
{
"name": "sample-react-project",
"version": "1.0.0",
"description": "Compile the project and launch it",
"main": "index.js",
"directories": {
"doc": "doc",
"test": "test"
},
"dependencies": {