This file contains hidden or 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
/* Trivial keyboard input layout to english switcher by Alexander V. Zhouravlev. | |
* Compile it with gcc -framework Carbon -o SwitchToEnglish SwitchToEnglish.m */ | |
#import <Carbon/Carbon.h> | |
int main (int argc, const char *argv[]) | |
{ | |
TISInputSourceRef english = TISCopyInputSourceForLanguage(CFSTR("en-US")); | |
if (!english) | |
return 1; |
This file contains hidden or 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
/* | |
* Compile with gcc -framework Foundation | |
*/ | |
#import <Foundation/Foundation.h> | |
struct internals { | |
int a; | |
int b; | |
}; |
This file contains hidden or 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
/* | |
* Syntax sugar for collections | |
* [overlap :@"key"].integer = 0; | |
* | |
* gcc -framework Foundation collections.m | |
* | |
*/ | |
#import <Foundation/Foundation.h> |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Name files like: L12-14 foreign translation.wav | |
import re, os, sys, tempfile, shutil | |
from subprocess import call | |
class Word: | |
filename = "" | |
def __init__(self, filename): | |
self.filename = filename |
This file contains hidden or 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
int ledState = 0; | |
int laserState = 0; | |
long prevTime = 0; | |
void setup() | |
{ | |
// laser on A0 | |
pinMode(A0, OUTPUT); | |
digitalWrite(A0, LOW); |
This file contains hidden or 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
(require '[bidi.ring :refer (make-handler)]) | |
(require '[ring.util.response :refer (response)]) | |
(def route-table ["/index.html" :index]) | |
(defn index-page [request] | |
(response "Hi!")) | |
(def handler-map | |
{:index index-page}) |
This file contains hidden or 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
import Foundation | |
import Darwin | |
func readInt() -> Int { | |
var res: Int = 0 | |
withUnsafePointer(&res) { | |
vscanf("%d", getVaList([COpaquePointer($0)])) | |
} | |
return res | |
} |
This file contains hidden or 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
import pandas as pd | |
def read_libra(path): | |
data = pd.read_csv(path, skiprows=3, sep=';') | |
data.rename(columns={'#date':'date'}, inplace=True) | |
return data | |
def read_hdo(path): | |
tmp = pd.read_csv(path, encoding='latin-1', nrows=5, header=4) | |
cols = tmp.columns |
This file contains hidden or 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
#![deny(unsafe_code)] | |
#![deny(warnings)] | |
#![no_std] | |
extern crate cortex_m; | |
extern crate embedded_hal as ehal; | |
extern crate stm32f30x_hal as hal; | |
mod beeper; |
This file contains hidden or 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
#[export_name = "_reset"] | |
pub unsafe extern "C" fn reset() -> ! { | |
asm!(" | |
cpsie i\n | |
movw r0, 0xd800\n | |
movt r0, 0x1fff\n | |
ldr r0, [r0]\n | |
msr MSP, r0" ::: "r0" : "volatile"); | |
let f = 0x1FFFD804u32 as *const fn(); | |
(*f)(); |
OlderNewer