Skip to content

Instantly share code, notes, and snippets.

View djaoka's full-sized avatar
🛡️
Security

djaoka djaoka

🛡️
Security
View GitHub Profile
import {
graphql,
GraphQLSchema,
GraphQLObjectType,
GraphQLString
} from 'graphql';
var schema = new GraphQLSchema({
query: new GraphQLObjectType({
name: 'RootQueryType',
@djaoka
djaoka / umount nfs
Created July 23, 2014 14:07
Umount NFS on Mac OS
1.Show the files in the folder :
ls /var/db/dslocal/nodes/Default/mounts
2.Delete what you want :
rm /var/db/dslocal/nodes/Default/mounts/<myfile>.plist
3.Reboot
@djaoka
djaoka / gist:0014b145a010e119edd6
Created July 14, 2014 13:12
Format UTF8 Sender for mailing in PHP
$email = '=?UTF-8?B?' . base64_encode($sender) . '?='." <".$email.">";
@djaoka
djaoka / gist:10721264
Created April 15, 2014 10:31
Breaking out of a PrototypeJS .each() loop
$$('.myClass').each(function(oElement){
if(oElement.getValue() == 'value'){
//Do something
}else{
//Leave the loop
throw $break;
}
});
@djaoka
djaoka / gist:10721037
Created April 15, 2014 10:28
Checked all checkboxes into an element (PrototypeJS)
$$('#mytable input[name^="bootyCheck"]').invoke('setValue', true);
@djaoka
djaoka / unchecked all
Created February 20, 2014 09:36
Unselect all checkboxes on a page - VanillaJS
[].forEach.call(document.querySelectorAll(" input[type='checkbox']"), function(el) { el.checked = false; });
@djaoka
djaoka / checked all
Created February 20, 2014 09:31
Select all checkboxes on a page - VanillaJS
[].forEach.call(document.querySelectorAll(" input[type='checkbox']"), function(el) { el.checked = false; });
<?php
ignore_user_abort();
function copyFileUrl($sFichier_url){
$sUrl = @fopen($sFichier_url, "rb");
if($sUrl != 0){
$sLocal = fopen($_SERVER['DOCUMENT_ROOT'].'/images/periods/tickets/159/293/conditions.jpg', "wb");
while(!feof($sUrl)){
$paquet = fread($sUrl, 65536);