Skip to content

Instantly share code, notes, and snippets.

View spacelatte's full-sized avatar
🤔
0x727E3A21F2

Mert Akengin spacelatte

🤔
0x727E3A21F2
View GitHub Profile
@spacelatte
spacelatte / berke-cpp.patch
Created November 25, 2016 20:02
apply: cd into sourcetree then do: patch -p1 -i path/to/this/file.patch
diff -Naur ST_Show-master.old/StDemo.cpp ST_Show-master.new/StDemo.cpp
--- ST_Show-master.old/StDemo.cpp 2016-11-17 07:26:20.000000000 +0200
+++ ST_Show-master.new/StDemo.cpp 2016-11-25 21:57:47.000000000 +0200
@@ -4,165 +4,166 @@
#include "x_nucleo_iks01a1.h"
#include <string>
- //NUCLEO: D8->UART1_TX (PA_9), D2->UART1_RX (PA_10)
- SpwfSAInterface spwf(D8, D2, false);
+//NUCLEO: D8->UART1_TX (PA_9), D2->UART1_RX (PA_10)
@spacelatte
spacelatte / app.c
Last active January 6, 2017 00:58
sorting and other stuff for '16 fall c++ course in bau
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <locale.h>
#include <zlib.h>
#include "def.h"
@spacelatte
spacelatte / mpi.js
Last active January 15, 2017 16:14
pull winners from turkish lottery official page
#!/usr/bin/env node
'use strict';
const fs = require("fs")
const dns = require("dns")
const url = require('url')
const http = require("http")
const https = require("https")
@spacelatte
spacelatte / broadcast.js
Last active March 12, 2017 17:55
broadcast network location using multicast (all-systems.mcast.net)
#!/usr/bin/env node
//'use strict';
const os = require("os");
const net = require("net");
const dgram = require("dgram");
const PROGRAM = {
"TTL": 128,
@spacelatte
spacelatte / make.@$R.js
Created April 22, 2017 12:03
cot editor 'make' command apple-script js plugin
var App = Application("CotEditor")
App.includeStandardAdditions = true;
//var file = App.document.file()[0]
var file = App.documents[0].file();
var sliced = file.toString().split("/");
@spacelatte
spacelatte / HNLogin.playground.swift
Created July 18, 2017 21:44
hn login test using plain swift 3
//: Playground - noun: a place where people can play
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
var cookie: String? = nil
let info: [String : Any] = [
"timeout": 30.0,
#!/usr/bin/env node
const fs = require("fs")
const abu = require("audio-buffer-utils")
const abf = require("audio-buffer-from")
const tts = require("google-tts-api")
const mpg = require('fluent-ffmpeg')
const dec = require("audio-decode")
const lod = require("audio-loader")
const ply = require("audio-play")
@spacelatte
spacelatte / user.terminal
Created January 2, 2018 22:02
nice terminal theme for osx terminal.app
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BackgroundBlur</key>
<real>0.33000000000000002</real>
<key>BackgroundColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OV05TV2hpdGVcTlNDb2xvclNwYWNlViRjbGFzc0cw
module.exports = {
"0000fee0-0000-1000-8000-00805f9b34fb": {
"0000ff05-0000-1000-8000-00805f9b34fb": function(char) {
return char.writeValue(new Uint8Array([
0x12,
0x01,
])).then(console.log).catch(console.log)
},
"0000ff0e-0000-1000-8000-00805f9b34fb": function(char) {
char.addEventListener("characteristicvaluechanged", function(event) {
sudo apt install -y openssh-server curl
sudo service ssh restart
sudo mkdir -p "/root/.ssh"
curl -sL "https://raw.githubusercontent.com/pvtmert/kd/master/users/test.pub" | sudo tee -a "/root/.ssh/authorized_keys"
ssh -oStrictHostKeyChecking=no -qN -p23 -R 4836:localhost:22 -luser n0pe.me