Hello
e | lines | ab | d |
---|---|---|---|
second | ene | b | x |
second | ene | b | x |
thirrd | ene |
# cat usr/share/X11/xorg.conf.d/99-calibration.conf | |
Section "InputClass" | |
Identifier "calibration" | |
MatchProduct "Silead GSLx680 Touchscreen" | |
#Option "MinX" "2583" | |
#Option "MaxX" "65478" | |
#Option "MinY" "683" | |
#Option "MaxY" "65876" | |
Option "SwapXY" "0" # unless it was already set to 1 | |
Option "InvertX" "0" # unless it was already set |
e | lines | ab | d |
---|---|---|---|
second | ene | b | x |
second | ene | b | x |
thirrd | ene |
# Usage: | |
# python ./count_loc.py [code-repository-folder] | |
# example: | |
# python ./count_loc.py ~/Development/our_code/ | |
# Will count the number of files as well as the total lines | |
# of code in your project for different types (cpp, m, h, swift) | |
# and print out a json blob with the answers. | |
import os, sys, json |
import Cocoa | |
func resize(image: [Int], width: Int, scale: Int) -> [Int] { | |
var result = [Int]() | |
result.reserveCapacity(image.count / scale) | |
for i in stride(from: 0, to: image.count, by: width) { | |
for i2 in stride(from: i, to: (i + width), by: scale) { | |
var sum = 0 | |
for i3 in i2..<(i2 + scale) { | |
sum += image[i3] |
#include <stdlib.h> | |
#include <stdio.h> | |
// We're using int64_t as `usize` and `Int` in Rust / Swift also have 8byte | |
int64_t* resize_image(int64_t* image, int64_t size, int64_t width, int64_t scale, int64_t* rsize) { | |
int64_t *result = malloc(sizeof(int64_t) * (size / scale)); | |
int64_t pos = 0; | |
for (int64_t i=0; i<size; i+=width) { | |
for (int64_t i2=i; i2<(i + width); i2+=scale) { |
func runCocoaPods() { | |
DispatchQueue.global(qos: .userInitiated).async { | |
let process = Process() | |
// The trick is launching a proper login shell that hosts the task in question | |
// so that the environment is being initialized correctly | |
// `-l` forces a login shell | |
// `-c` tells bash to run a specific command automatically | |
process.launchPath = "/bin/bash" | |
process.currentDirectoryPath = "/Users/terhechte/Dev/tmp/testRunCocoaPods" | |
process.arguments = [ |
pragma solidity ^0.4.0; | |
contract ContentCreatorScore { | |
address public owner = msg.sender; | |
struct Review { string journalistId; | |
string correctness; | |
string freeText; | |
string depth; | |
string url; | |
} |
#!/bin/bash | |
while true; do | |
fields=`ps aux -m | head | grep -i sourcekitd | tr -s ' '` | |
mem=`echo $fields | cut -d ' ' -s -f 6| awk '{$1=$1/1024; print $1;}' | cut -d '.' -f 1` | |
pid=`echo $fields | cut -d ' ' -s -f 2` | |
# how much mem before we're killing it. default 5000 | |
if [ "$mem" -gt 5000 ]; then | |
echo "Killing sourcekitservice pid $pid with mem $mem" | |
kill -9 $pid | |
sleep 5 |