Skip to content

Instantly share code, notes, and snippets.

View ddo's full-sized avatar
🌚
Fixing the world

Ddo ddo

🌚
Fixing the world
View GitHub Profile
@ddo
ddo / facebook.get.userid.ie8.php
Created November 2, 2012 13:50
IE8 can not get the User ID by Facebook SDK.
#Set this header on every php file
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
@ddo
ddo / showphperror.php
Created November 15, 2012 10:42
show php error
ini_set('display_errors',1);
error_reporting(E_ALL|E_STRICT);
@ddo
ddo / isnumber.js
Created November 22, 2012 08:33
is number Javascript
function isNumber(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
}
function ajax(callback, url){
var is_question_mark = url.indexOf("?");
var remove_cache = "?random=" + Math.random();
if(is_question_mark > 0) {
remove_cache = "&random=" + Math.random();
}
if ($.browser.msie && window.XDomainRequest && $.browser.version < 10) { //code for IE 10-
var http_request = new XDomainRequest();
<?php
header( 'Content-type: text/html; charset=utf-8' );
echo 'Begin ...<br />';
for( $i = 0 ; $i < 10 ; $i++ )
{
echo $i . '<br />';
flush();
ob_flush();
sleep(1);
USE tlnmd
GO
SELECT t.name AS table_name,
SCHEMA_NAME(schema_id) AS schema_name,
c.name AS column_name
FROM sys.tables AS t
INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
WHERE c.name = 'office_owner'
ORDER BY table_name
@ddo
ddo / Preferences.sublime-settings
Last active September 14, 2017 10:26
Sublime settings
{
"font_face": "Source Code Pro",
"font_size": 13,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"theme": "Seti_orig.sublime-theme",
"translate_tabs_to_spaces": true,
[
{ "keys": ["crt+shift+t"], "command": "open_terminal" },
{ "keys": ["crt+shift+alt+t"], "command": "open_terminal_project_folder" }
]
@ddo
ddo / README.md
Last active March 24, 2023 19:17 — forked from nicerobot/README.md
uninstall-node.sh

To run this, you can try:

curl -ks https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh | bash

I haven't tested this script doing it this way but i run a lot of my Gists like this so maybe this one'll work too.

Alternatively,

curl -ksO https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh

chmod +x ./uninstall-node.sh

@ddo
ddo / chat.go
Last active August 29, 2015 14:17
package main
import (
"bufio"
"net"
)
type Client struct {
incoming chan string
outgoing chan string