Skip to content

Instantly share code, notes, and snippets.

レンスキールド / Rehnskiöld thunderrun

Block or report user

Report or block thunderrun

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@thunderrun
thunderrun / session-job-script.conf
Created Sep 20, 2017
exec script on login ~/.config/upstart/session-job-script.conf
View session-job-script.conf
description "Session Job Script"
start on desktop-start
stop on desktop-end
script
xinput --set-prop "Logitech USB Optical Mouse" "Device Accel Profile" -1
xinput --set-prop "Logitech USB Optical Mouse" "Device Accel Constant Deceleration" 1.5
redshift -O 4200 -l 32:120
end script
View vanilla-example.js
let app = document.querySelector('app');
app.innerHTML = `<button class="set-button" onclick="navigateToEmailForm()" >Set Email Address</button>`;
const regex = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
let emailValid = false;
const validateEmail = (e) => {
let saveButton = document.querySelector('.save-button');
emailValid = regex.test(e.value);
saveButton.disabled = !emailValid;
View vue-example.js
// main.js
import Vue from 'vue';
import VueResource from 'vue-resource';
import App from './App';
import router from './router';
Vue.use(VueResource);
Vue.config.productionTip = false;
View react-example.jsx
// index.js
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
ReactDOM.render(
<App />,
document.getElementById('root')
);
@thunderrun
thunderrun / angular-example.js
Created Jul 23, 2017
use .js as ext. for syntax highlight reason
View angular-example.js
// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppRoutingModule } from './app-routing.module';
import { InMemoryWebApiModule } from 'angular2-in-memory-web-api';
View angularjs-example.js
// app.module.js
angular.module('exampleApp', [
'ngRoute',
'core',
'navigator',
'emailForm'
]);
// app.config.js
angular.
View increase1.js
let string = `
enum Task_type {
NORMAL_SCAN = 0; // 普通扫描
FULL_SCAN = 1; // 全盘扫描
EMERGENCY_SCAN = 2; // 紧急扫描
UPDATE_BASIC_INFO = 3; // 更新基础信息
UPDATE_PLUGIN_INFO = 4; // 升级插件
LEAK_FREE_FIX = 5;//?? 不知道是什么任务
DRIVE_C_SCAN = 6;// 扫描C盘?
CANCEL_TASK = 7;//取消任务
View display-picture.html
<!DOCTYPE html>
<html>
<body>
<div class="pictures">
</div>
<script>
// mock http call
View clear-form.html
<!DOCTYPE html>
<html>
<body>
<input class="name-input" type="text" placeholder="Name" >
<input type="submit" value="Submit" onclick="clearForm()">
<script>
const clearForm = () => {
View highlight-example.html
<!DOCTYPE html>
<html>
<head>
<title>highlight example</title>
<style>
span {
background-color: yellow
}
</style>
You can’t perform that action at this time.