Skip to content

Instantly share code, notes, and snippets.

View wedojava's full-sized avatar
🎯
Focusing

回风 wedojava

🎯
Focusing
View GitHub Profile
@wedojava
wedojava / gist:3b7f06d13d6612a7232e
Last active August 29, 2015 14:17
[转]解决sudo: sorry, you must have a tty to run sudo
在网上了解到可以如下解决:
1. 编辑 /etc/sudoers
1)Defaults requiretty,修改为 #Defaults requiretty,表示不需要控制终端。
2)Defaults requiretty,修改为 Defaults:nobody !requiretty,表示仅 nobody 用户不需要控制终端。
如果修改为 Defaults:%nobody !requiretty,表示仅 nobody 组不需要控制终端。
其实只要注释掉)Defaults requiretty 那个就可以了。表示在执行的时候不打开终端。但是,有的shell必须要有终端才可以执行。这样显然是不行的。后来,又找到一片文章才搞定。下面为抄录的,仅为记录以后使用。
@wedojava
wedojava / gist:6f913c14814a417bb881
Last active August 29, 2015 14:17
vagrant启动报错The following SSH command responded with a non-zero exit status.

###报错信息:

  The following SSH command responded with a non-zero exit status.
  
  Vagrant assumes that this means the command failed!
  
  ARPCHECK=no /sbin/ifup eth1 2> /dev/null
  
  Stdout from the command:
 
@wedojava
wedojava / gist:50d991c0721ed4eeafdd
Created March 25, 2015 05:08
Fix “Class ‘Form’ or ‘HTML’ not found” in Laravel 5
If you’re upgrading from Laravel 4 to Laravel 5, you’re most likely going to come across one of these two errors:
Class ‘Form’ not found
or
Class ‘Html’ not found
This is a really simple fix. Open up your composer.json file and require:
“illuminate/html”: “~5.0″
Then open up config/app.php and add the Html service provider to the providers array:
@wedojava
wedojava / gist:41296a19a759a57c3d6d
Created March 25, 2015 09:59
用laravel5做下拉列表,列表内容从数据库读取
放个例子:
视图:{!!Form::select('difficulty', $difficulties)!!}
控制器:
public function edit($id)
{
return view('admin.questions.edit')
->withQuestion(Question::find($id))
->withDifficulties(Difficulty::lists('name', 'id'));
}
@wedojava
wedojava / Material-Theme-BHL.sublime-theme
Last active December 22, 2015 06:06
MySublimeText3-Settings
[
/* @ EMPTY WINDOW
* Style for empty (no tabs) window
* 安装完 Material Theme 后,此文件放到 Packages/Material Theme/ 目录下面即可
* 主要修改了原有的背景颜色来搭配 Facebook (SL).tmTheme
========================================================================= */
{
"class": "sheet_container_control",
{
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Material Theme",
"terminal.integrated.fontFamily": "Fira Code",
"editor.fontFamily": "'Fira Code', 'Fira Mono', Consolas, 'Courier New', monospace",
"editor.lineNumbers": "off",
"editor.lineHeight": 20,
"editor.fontSize": 13,
"editor.fontLigatures": true,
"terminal.integrated.fontWeightBold": "bold"
@wedojava
wedojava / init.md
Last active February 10, 2020 06:33
windows init setting

GPEdit

gpedit.msc

Scoop

Install Scoop

set-executionpolicy remotesigned -scope currentuser
iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
@wedojava
wedojava / sublimeConfig
Created February 19, 2020 18:50
sublimeConfig[mac]
{
"always_show_minimap_viewport": false,
"bold_folder_labels": false,
"color_scheme": "Packages/User/SublimeLinter/Facebook (SL).tmTheme",
"enable_tab_scrolling": false,
"font_face": "Fira Code",
"font_options":
[
"gray_antialias"
],
@wedojava
wedojava / PatchExtract125.ps1
Created July 29, 2020 10:22 — forked from anonymous/PatchExtract125.ps1
Patch Extract v1.25 by Greg Linares (@Laughing_Mantis)
<#
================
PATCHEXTRACT.PS1
=================
Version 1.25 Microsoft MSU Patch Extraction and Patch Organization Utility by Greg Linares (@Laughing_Mantis)
This Powershell script will extract a Microsoft MSU update file and then organize the output of extracted files and folders.
Organization of the output files is based on the patch's files and will organize them based on their archicture (x86, x64, or wow64)
as well as their content-type, ie: resource and catalog files will be moved to a JUNK subfolder and patch binaries and index files will
@wedojava
wedojava / Faucet.sol
Last active August 21, 2020 04:10
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.26+commit.4563c3fc.js&optimize=false&gist=
pragma solidity ^0.4.17;
contract Faucet{
function withdraw(uint amount) public {
require(amount<= 1000000000000000000);
msg.sender.transfer(amount);
}
function() public payable{}
}