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; | |
using System.Collections.Generic; | |
using System.Data.SQLite; | |
namespace Sqlite3ToJson | |
{ | |
class Program | |
{ | |
static void Execute(string connectionString, string sql, Action<SQLiteDataReader> action) | |
{ |
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; | |
using System.Data.SQLite; | |
using System.IO; | |
using System.Text; | |
using Newtonsoft.Json; | |
namespace Sqlite3ToJson | |
{ | |
class Program |
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> | |
<style> | |
.container { | |
width:400px; | |
height:400px; | |
float:left; | |
position:relative; | |
background:#ccc; | |
overflow:hidden; |
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
const _ = require('lodash'); | |
const assert = require('assert'); | |
const rotate = (value, max, min) => { | |
const distance = max - min + 1; | |
if (value > max) { | |
return min + ((value - max - 1) % distance); | |
} else if (value < min) { | |
return max - ((min - value - 1) % distance); |
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
# CTRL+ALT+F2 to another console and then | |
sudo pacman -Syu | |
sudo pacman -S gdm | |
sudo systemctl disable lightdm | |
sudo systemctl enable gdm | |
sudo systemctl stop lightdm | |
sudo systemctl start gdm |
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
var nsp = io.of('/conn'); | |
nsp.on('connection').on('authenticated', (socket) => { | |
socket.on('triggerDisconnect', (d) => { | |
if (nsp.connected[socket.id]) { | |
nsp.connected[socket.id].disconnect(); | |
} | |
}); | |
}); |
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
'use strict'; | |
let i = 0; | |
const fn = () => { | |
if (i++ < 5) | |
throw new Error(`crap ${i}`); | |
return "success"; | |
}; |
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
// npm i request-promise | |
// node node-bad-ssl-test.js | |
const rp = require('request-promise'); | |
const url = 'https://self-signed.badssl.com'; | |
const r1 = rp.get(url, { rejectUnauthorized: true }); | |
r1.then((body) => { |
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
@echo off | |
set cassie_running=0 | |
set creeper_running=0 | |
set roguecode_running=0 | |
call:stopVmIfItIsRunning "roguecode" roguecode_running | |
call:stopVmIfItIsRunning "creeper" creeper_running | |
call:stopVmIfItIsRunning "cassie" cassie_running |
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
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0"; | |
let fs = require('fs'); | |
let mw = require('nodemw'); | |
let count = 0; | |
let client = new mw({ | |
protocol: "http", | |
server: 'en.wikipedia.org', | |
path: '/w', | |
debug: false |
OlderNewer