This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// operator-overloading.cpp : Defines the entry point for the Operator Overloading application. | |
// | |
#include <cstdlib> | |
#include <iostream> | |
using namespace std; | |
class Nums{ | |
private: | |
int x, y, z; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function insert($table, $data) | |
{ | |
$q = 'insert into ' . $table . ' values('; | |
for ($i = 0; $i < count($data); $i++) { | |
$q .= ($i == 0) ? '?' : ',?'; | |
} | |
$q .= ');'; | |
$dsn = 'mysql:host=' . DBHOST . ';dbname=' . DBNAME; | |
try { | |
$pdo = new PDO($dsn, DBUSER, DBPASS); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Security.Cryptography; | |
using System.Text; | |
namespace Snippets | |
{ | |
public static class SHA1Util | |
{ | |
/// <summary> | |
/// Compute hash for string encoded as UTF8 | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getGithubUserInfo(username) { | |
return new Promise(function (resolve, reject) { | |
// Do the usual XHR stuff | |
var url = "https://api.github.com/users/" + username; | |
var req = new XMLHttpRequest(); | |
req.open('GET', url); | |
req.onload = function () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Removing current Nvidia installation. | |
sudo apt-get purge nvidia* | |
sudo apt-get purge bumblebee* | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
## Installing Kernel header if didn't already |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include $(GOROOT)/src/Make.inc | |
GOFMT=gofmt -spaces=true -tabindent=false -tabwidth=4 | |
all: | |
$(GC) jsontest.go | |
$(LD) -o jsontest.out jsontest.$O | |
format: | |
$(GOFMT) -w jsontest.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Eventizer Document</title> | |
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css"> | |
<style> | |
ul > li { | |
padding: 5px 0; | |
} | |
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package twitterfindname | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// First way: | |
(function(){ | |
// code here | |
})(); | |
// Second way: | |
(function(){ | |
// code here | |
}).call(this); |
OlderNewer